Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error reporting when target sysroot is missing. #37424

Merged
merged 1 commit into from
Nov 18, 2016

Conversation

shiver
Copy link
Contributor

@shiver shiver commented Oct 27, 2016

Attempts to resolve #37131.
This is my first pull request on rust, so I would greatly appreciate any feedback you have on this.

Thanks!

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@nrc
Copy link
Member

nrc commented Oct 27, 2016

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned nrc Oct 27, 2016
@bors
Copy link
Contributor

bors commented Oct 28, 2016

☔ The latest upstream changes (presumably #37350) made this pull request unmergeable. Please resolve the merge conflicts.

@brson
Copy link
Contributor

brson commented Nov 9, 2016

Thanks @shiver!

This looks good to me, with the exception that it needs a test.

I'd say the best way to do it is to add a test to src/test/compile-fail that is annotated with

// compile-flags: --target=s390x-unknown-linux-gnu
// ignore s390x

You can crib off other tests in that directory for details.

@brson brson assigned brson and unassigned alexcrichton Nov 9, 2016
@shiver
Copy link
Contributor Author

shiver commented Nov 9, 2016

Excellent! Thanks for the feedback.

I'll hopefully push the test in the next day or two.


if !custom_target {
args.extend(vec![
format!("{}", target),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be --target={}, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that.
Definitely a bug. I was having some issues with the tests, sometimes all passing (possibly because I wasn't recompiling rustc correctly), so I didn't pick that up.

Hopefully the latest commit addresses this.


if (self.ident == "std" || self.ident == "core")
&& self.triple != config::host_triple() {
err.note(&format!("the `{}` target is not installed", self.triple));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this could be "may not be installed" as it may actually be and we could be error'ing for some other reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that seems like a better idea.
I have changed the message to read "the <target> target may not be installed".

@alexcrichton
Copy link
Member

Thanks! Want to squash the commits?

@shiver
Copy link
Contributor Author

shiver commented Nov 17, 2016

Hopefully squashed in the correct manner. Let me know if you see any issues though!

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 17, 2016

📌 Commit 66de87f has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Nov 17, 2016

⌛ Testing commit 66de87f with merge c356537...

bors added a commit that referenced this pull request Nov 17, 2016
Improved error reporting when target sysroot is missing.

Attempts to resolve #37131.
This is my first pull request on rust, so I would greatly appreciate any feedback you have on this.

Thanks!
@bors bors merged commit 66de87f into rust-lang:master Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a better error message when the target sysroot is not installed
6 participants